import java.util.*;
public class Main{
    public static void main(String[]args){
        Scanner scan=new Scanner(System.in);
        String str=scan.nextLine();
        char[]ch=str.toCharArray();
        int len=ch.length;
        reverse(ch,0,len-1);
        int i=0;
        while(i<len){
            int j=i;
            while(j<len&&ch[j]!=' '){
                j++;
            }
            reverse(ch,i,j-1);
            i=j+1;
        }
        System.out.println(ch);
    }
    public static void reverse(char[]ch,int start,int end){
        while(start<end){
            char tmp=ch[start];
            ch[start]=ch[end];
            ch[end]=tmp;
            start++;
            end--;
        }
    }
}